#define _CRT_SECURE_NO_WARNINGS
#include"DList.h"

void LTtest1()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPrint(plist);

	LTPopBack(plist);
	LTPrint(plist);

	LTPopBack(plist);
	LTPrint(plist);

	LTPopBack(plist);
	LTPrint(plist);

	LTPopBack(plist);
	LTPrint(plist);

	


}

void LTtest2()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPrint(plist);
	LTPushFront(plist, 5);
	LTPushFront(plist, 6);
	LTPushFront(plist, 7);
	LTPrint(plist);


	LTPopFront(plist);
	LTPrint(plist);

	LTPopFront(plist);
	LTPrint(plist);

	LTPopFront(plist);
	LTPrint(plist);

	LTNode* pos1 = LTFind(plist,1);
	LTInsert(pos1, 0);
	LTPrint(plist);

	LTNode* pos2 = LTFind(plist, 4);
	LTInsert(pos2, 4);
	LTPrint(plist);

	LTErase(pos2);
	pos2 = NULL;
	LTErase(pos1);
	pos1 = NULL;
	LTPrint(plist);

	LTDestroy(plist);
	plist = NULL;


}
int main()
{
	LTtest2();
	return 0;
}